package cn.webrx.coll;/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.TreeSet;

/**
 * <p>Project: jse2204 - cn.webrx.coll.BallDemo
 * <p>Powered by webrx On 2022-09-20 09:00:15
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class BallDemo {
    public static void main(String[] args) {
        //Map HashMap
        //Set TreeSet HashSet
        //List ArrayList
        Random rand = new Random();
        int i = 0;
        //红 1-33 6
        //蓝 1-16 1
        Map<String, List<Set<Integer>>> v = new HashMap<>();
        while (true) {
            List<Set<Integer>> list = new ArrayList<>();
            Set<Integer> red = new TreeSet<>();
            while(red.size() != 6){
                red.add(rand.nextInt(1,34));
            }
            list.add(red);

            Set<Integer> blue = new HashSet<>();
            blue.add(rand.nextInt(1,17));
            list.add(blue);

            v.put("" + ++i, list);
            if (i == 10) break;
        }
        //System.out.println(v);
        v.forEach((k,vv)->{
            System.out.printf("%s = %s%n",k,vv);
        });


    }
}
